#!/usr/bin/env python
# coding=utf-8


import sys
import time
import datetime
import pprint



from utils.checkURL import getHttpStatus
from utils.custom_argparse import parse_args
from common.config import Summary
from build.package import PackageApp
# from deploy.service import
# from deploy_check_url import getHttpStatus
# from deploy_package import PackageApp
# from deploy_publish import PublishApp
# from deploy_service import ServiceOps
from utils.custom_log import log_start
logger = log_start('main')
    
# def optionsCheck(params):
#     if not params.hosts and params.do_what != 'package':
#         error_msg = 'You must select a target host !!!'
#         logger.error(error_msg)
#         raise ValueError(error_msg)
        

if __name__ == '__main__':
    ## 如果脚本没有传参则打印帮助信息
    if len(sys.argv) == 1:
        sys.argv.append("--help")
        parse_args()
        sys.exit(0)
    
    ## 获取外部变量(jenkins)
    jenkins_params = parse_args() 
    inventory = Summary(jenkins_params)
    print(inventory.app_cluster_name)

    # if jenkins_params.do_what ==  'package' or jenkins_params.do_what == 'publish' :
    #     Package = PackageApp(jenkins_params)    
    #     Package.run()

    # if jenkins_params.do_what == 'stop':
    #         pass


